home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / sos3-2.lha / src / scp / scp_main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-23  |  1.2 KB  |  43 lines

  1. /* --------------------------------------------------------------------------
  2.  * Copyright 1992 by Forschungszentrum Informatik (FZI)
  3.  *
  4.  * You can use and distribute this software under the terms of the licence
  5.  * you should have received along with this program.
  6.  * If not or if you want additional information, write to
  7.  * Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
  8.  * D-7500 Karlsruhe 1, Germany.
  9.  * --------------------------------------------------------------------------
  10.  */
  11. #include "sos.h"
  12. #include "smg.h"
  13. #include "scp_err.h"
  14. #include "scp_yacc.h"
  15.  
  16. main (int argc, char *argv[])
  17. {  sos_init (argc, argv);
  18.  
  19.    if (argc != 3)
  20.    {  err_raise (err_USE, err_SCP_USAGE, NULL, FALSE);
  21.       exit (1);
  22.    }
  23.  
  24.    sos_String n = smg_String (argv[1]).make_String (TEMP_CONTAINER);
  25.    scp_mdl = sos_Schema_module::lookup (n);
  26.    n.destroy();
  27.    if (scp_mdl == NO_OBJECT)
  28.    {  err_raise (err_USE, err_SCP_NO_SCHEMA, argv[1], FALSE);
  29.       exit (1);
  30.    }
  31.  
  32.    yyin = fopen (argv[2], "r");
  33.    if (yyin == 0)
  34.    {  err_raise (err_USE, err_SCP_NO_FILE, argv[2], FALSE);
  35.       exit (1);
  36.    }
  37.  
  38.    cout << "#line 1 \"" << argv[2] << "\"\n";
  39.    scp_compile();
  40.  
  41.    exit (0);
  42. }
  43.